How to automatically resolve an incident in PagerDuty by closing the issue in Gitlab

Hi everyone, I have the following question:

  1. I created the GitLab Webhook integration and able to automatically create GitLab issues when Incident is created in PagerDuty.

  2. However, is it possible to automatically Resolve the Incident in PagerDuty when a responder Closes the GitLab issue?

Thank you in advance.

Hi @maxim.zverev,

Here’s an integration guide that can help you with merging requests: https://support.pagerduty.com/docs/gitlab-changes

Can you let me know later if you found what you needed there?

Hi Xenda,

This is not what I need. Yes, I can track merge requests - but:

  1. they don’t change the status of the incident in PagerDuty automatically
  2. and most importantly - NOT all incidents are resolved with merge requests (as an example: one of my services is down and I can simply restart it to resolve the issue - as you can see - I don’t need to modify the code). What I need is this: when I close the GitLab issue associated with the PagerDuty incident - that incident is resolved automatically.

Hi there Maxim,

I did some more research, and here’s what I could find:

  1. Configure GitLab Webhook: In GitLab, set up a webhook that sends notifications to your custom script or service whenever an issue is closed. The script will then handle the process of notifying PagerDuty.

  2. Custom Script or Integration Service: Create a custom script or use an integration service (such as a serverless function) that receives the webhook data from GitLab when an issue is closed. The script should then use the PagerDuty API to resolve the corresponding PagerDuty incident.

  3. PagerDuty API: Use the PagerDuty API to interact with the incidents. Specifically, you’ll use the API to update the status of the PagerDuty incident to “resolved” or “closed” when the GitLab issue is closed. You’ll need to authenticate with the PagerDuty API using appropriate credentials.

Was this helpful?

  • YES :+1:
  • NO :-1:

0 voters